import { useTheme } from '../../contexts/ThemeContext';
import { FiSun, FiMoon } from 'react-icons/fi';
import styles from '../../styles/components/ui/ThemeToggle.module.scss';

const ThemeToggle = () => {
  const { theme, toggleTheme } = useTheme();

  return (
    <button className={styles.themeToggle} onClick={toggleTheme}>
      {theme === 'light' ? <FiMoon /> : <FiSun />}
      <span>{theme === 'light' ? '暗黑模式' : '明亮模式'}</span>
    </button>
  );
};

export default ThemeToggle;